import * as echarts from 'echarts/core'
import {
  TitleComponent,
  ToolboxComponent,
  TooltipComponent,
  GridComponent,
  LegendComponent,
} from 'echarts/components'
import { LineChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'

echarts.use([
  TitleComponent,
  ToolboxComponent,
  TooltipComponent,
  GridComponent,
  LegendComponent,
  LineChart,
  CanvasRenderer,
])
let option = {
  color: ['#FE827A'],

  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      label: {
        backgroundColor: '#FE827A',
      },
    },
  },
  grid: {
    top: '10%',
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true,
  },
  xAxis: [
    {
      type: 'category',
      boundaryGap: false,
      nameTextStyle: {
        fontWeight: 'lighter',
      },
      data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月'],
    },
  ],
  yAxis: [
    {
      type: 'value',
    },
  ],
  series: [
    {
      name: 'Line 1',
      type: 'line',
      stack: '总量',
      smooth: true,
      lineStyle: {
        width: 2,
      },
      showSymbol: false,
      areaStyle: {
        opacity: 0.8,
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          {
            offset: 0,
            color: 'RGBA(255, 241, 240, 1)',
          },
          {
            offset: 1,
            color: 'rgba(255, 255, 355)',
          },
        ]),
      },
      emphasis: {
        focus: 'series',
      },
      data: [16200, 15834, 16239, 14223, 16423, 15772, 16630],
    },
  ],
}

export default option
